<?php
$this->menu = array(
	array('label'=>'品牌管理列表', 'url'=>array('admin'), 'visible'=>Yii::app()->user->v('manage@BrandAdmin')),
);
$cs = Yii::app()->clientScript;
$cs->registerScriptFile(BASE_URL . '/js/jquery_plus/jquery.form.js', CClientScript::POS_END);
?>
<h2><a href="/manage/Brand/admin">品牌管理列表</a> > 品牌编辑</h2>
<?php 
$this->beginWidget('CActiveForm', array(
	'id'			=> 'brand_cate_form',
	'htmlOptions' 	=> array('class'=>'setting_form'),
));
?>
	<div class="setting_nav"></div>
	<dl class="setting_content">
		<dt>基本信息</dt>
		<dd>
			<strong>品牌名称：</strong>
			<?php echo YHtml::activeTextField($model, 'name', array('model'=>'Brand', 'rule'=>'^.{1,50}$', 'next_focus'=>''))?>
		</dd>
		<dd>
			<strong>分类：</strong>
			<?php 
			$cates = isset($model['cate'])?$model['cate']:null;
			$this->widget('manage.widget.YSelectorWidget', array(
				'default_text' 	=> '点击设置分类',
				'name'			=> 'Brand[cate][]',
				'type' 			=> 'mutil_select',
				'options' 		=> GoodsCateModel::getTree(),
				'value'			=> $cates,
				'value_text'	=> GoodsCateModel::getName($cates, '.', '<br>'),
				'title'			=> '请选择商品分类',
// 				'on_show'		=> 'on_text_selector_selected'
			));
			?>
			<?php //echo YHtml::activeDropDownList($model, 'cate', GoodsCateModel::getOpts(), array('model'=>'Brand', 'next_focus'=>''))?>
			<p>
				<?php 
				echo YHtml::link('添加商品分类', '/Manage/GoodsCate/Edit', array(
					'visible'	=> Yii::app()->user->v('manage@GoodsCateEdit')
				))
				?>
			</p>
		</dd>
		<dd>
			<strong>排序：</strong>
			<?php echo YHtml::activeTextField($model, 'rank', array('model'=>'Brand', 'rule'=>'^\d+$', 'next_focus'=>''))?>
			<p>排序值，越小越前</p>
		</dd>
		<dd>
			<strong>官方网站：</strong>
			<?php echo YHtml::activeTextField($model, 'site', array('model'=>'Brand', 'next_focus'=>''))?>
		</dd>
		<dt>品牌标识</dt>
		<dd>
			<strong>标识：</strong>
			<?php 
			$this->widget('manage.widget.EnumsSelectorWidget', array(
				'code' => 'brand_flags',
				'name' => 'Brand[brand_flags][]',
				'values' => isset($model['brand_flags'])?$model['brand_flags']:null
			));
			?>
		</dd>
		<dt>品牌Logo</dt>
		<dd>
			<?php 
			$this->widget('manage.widget.UploaderWidget',array(
				'pictures' 	=> isset($model['pictures'])?$model['pictures']:null,
				'mutil' 	=> false
			));
			?>
		</dd>
		<dt>品牌描述</dt>
		<dd>
			<?php 
			$this->widget('application.widget.EditorWidget',
				array(
					'name'	=> 'Brand[desc]',
					'id'	=> 'editor_desc',
					'value' => (isset($model['desc'])?$model['desc']:''),
				)
			);
			?>
		</dd>
	</dl>
	<div class="buttons right">
		<?php echo YHtml::activeHiddenField($model, '_id', array('model'=>'Brand'))?>
		<input type="button" class="button save_btn" value="保存"/>
	</div>
<?php $this->endWidget(); ?>